import { ZFormItemSchema } from "@/components/Form/typings";
import { ZTableColumn } from "@/components/Table/typings";

export const getColumns = (): ZTableColumn[] => [
  {
    title: "Name",
    key: "name",
  },
  {
    title: "Age",
    key: "age",
  },
  {
    title: "Address",
    key: "address",
  },
  {
    title: "Custom",
    key: "custom",
    render: ({ rowData }) => {
      return <>{rowData.name + "@" + rowData.address}</>;
    },
  },
];

export const getSearchSchemas = (): ZFormItemSchema[] => [
  {
    label: "起始索引",
    path: "startIndex",
    span: 12,
    component: "NInputNumber",
  },
  {
    label: "日期",
    path: "date",
    span: 12,
    component: "NDatePicker",
  },
  {
    label: "启用",
    path: "enable",
    component: "NCheckbox",
    componentModelValue: "checked",
    required: true,
  },
];
